<?php
namespace app\index\controller;

use app\index\controller\common as common;

use app\index\model\Project as Project;
use app\index\model\Assets as Assets;
use app\index\model\Pipeline as Pipeline;


// use app\index\validate\IDMustBePositiveInt;


class Index extends common
{

    /*配置公共函数*/
    protected $fieldStatus = 'status';
    public function index($id=2)
    {

        $all_project_name = Project::get_data() ;
        $this->assign('project_name', $all_project_name) ;

        $data = Pipeline::get_pip_cate_data($id);
        $this->assign('data', $data) ;

        $get_project_name = Project::field('project_name')->find($id);
        $this->assign('now_project_name', $get_project_name) ;

        return $this->view->fetch();
    }   

    public function video()
    {
        return $this->view->fetch();
    }    
     


     public function forbid($id)
    {   
        $data= ['id'=>$id, $this->fieldStatus=>0] ;
        Assets::update_data($data) ;
        return ajax_return_adv("修改成功", '') ;
    }

     public function resume($id)
    {
        $data= ['id'=>$id, $this->fieldStatus=>1] ;
        Assets::update_data($data) ;
        return ajax_return_adv("修改成功", '') ;
    }
}

